﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using User.API.Data;
using User.API.Data.Mapping;
using User.API.Mapping;

namespace User.API
{
    public class ApplicationDbContext
        :DbContext
    {
        public ApplicationDbContext(DbContextOptions<ApplicationDbContext> opt)
            :base(opt)
        {}

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.ApplyConfiguration(new AppUserMap());
            modelBuilder.ApplyConfiguration(new UserPropertyMap());
            modelBuilder.ApplyConfiguration(new BPFileMap());
            modelBuilder.ApplyConfiguration(new UserTagMap());
            //base.OnModelCreating(modelBuilder);
        }
        public DbSet<AppUser> AppUser { get; set; }
        public DbSet<UserProperty> UserProperty { get; set; }
        public DbSet<UserTag> UserTag { get; set; }
        public DbSet<BPFile> BPFile { get; set; }
    }
}
